import { component$ } from "@builder.io/qwik";
import AdminLayout from "~/components/AdminLayout";
import SubscriptionForm from "~/components/SubscriptionForm";
import SubscriptionList from "~/components/SubscriptionList";
import type { Subscription } from '~/types';


// Mock data - replace with actual API calls
const mockSubscriptions: Subscription[] = [
  {
    id: '1',
    url: 'https://example.com/blog',
    category: 'Blog',
    pattern: '.*\.md$',
    schedule: 'Daily',
    lastChecked: '2024-03-10T10:00:00Z',
    resourceCount: 15,
    status: 'active'
  },
  {
    id: '2',
    url: 'https://news.example.com',
    category: 'News',
    pattern: '.*\.html$',
    schedule: 'Every hour',
    lastChecked: '2024-03-10T11:00:00Z',
    resourceCount: 42,
    status: 'active'
  }
];


export default component$(() => {
	return (
		<AdminLayout>
			<div class="space-y-6">
        <div>
          <h1 class="text-2xl font-semibold text-gray-900">Manage Subscriptions</h1>
        </div>

        <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
          <div class="lg:col-span-2">
            <SubscriptionList subscriptions={mockSubscriptions} />
          </div>
          <div>
            <SubscriptionForm />
          </div>
        </div>
    </div>
		</AdminLayout>
	)
});
